<!DOCTYPE HTML>
<html>

<head>
	<link rel="bookmark"  type="image/x-icon"  href="/img/logo_miccall.png"/>
	<link rel="shortcut icon" href="/img/logo_miccall.png">
	
			    <title>
    Ame雨
    </title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <link rel="stylesheet" href="/amelin-ting/css/mic_main.css" />
    <link rel="stylesheet" href="/amelin-ting/css/dropdownMenu.css" />
    <meta name="keywords" content="Ame雨" />
    
    	<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
	 
    <noscript>
        <link rel="stylesheet" href="/amelin-ting/css/noscript.css" />
    </noscript>
    <style type="text/css">
        body:before {
          content: ' ';
          position: fixed;
          top: 0;
          background: url('/amelin-ting/img/bg.jpg') center 0 no-repeat;
          right: 0;
          bottom: 0;
          left: 0;
          background-size: cover; 
        }
    </style>

			    
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script async type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


    <script src="/amelin-ting/js/jquery.min.js"></script>
    <script src="/amelin-ting/js/jquery.scrollex.min.js"></script>
    <script src="/amelin-ting/js/jquery.scrolly.min.js"></script>
    <script src="/amelin-ting/js/skel.min.js"></script>
    <script src="/amelin-ting/js/util.js"></script>
    <script src="/amelin-ting/js/main.js"></script>
	
<meta name="generator" content="Hexo 5.4.0"></head>
    
		
<!-- Layouts -->



<!--  代码渲染  -->
<link rel="stylesheet" href="/css/prism_coy.css" />
<link rel="stylesheet" href="/css/typo.css" />
<!-- 文章页 -->
<body class="is-loading">
    <!-- Wrapper 外包 s-->
    <div id="wrapper" class="fade-in">
        <!-- Intro 头部显示 s -->
        <!-- Intro 头部显示 e -->
        <!-- Header 头部logo start -->
        <header id="header">
    <a href="/amelin-ting/" class="logo">Art Space</a>
</header>
        <!-- Nav 导航条 start -->
        <nav id="nav" class="special" >
            <ul class="menu links" >
			<!-- Homepage  主页  --> 
			<li >
	            <a href="/amelin-ting/" rel="nofollow">主页</a>
	        </li>
			<!-- categories_name  分类   --> 
	        
	        <li class="active">
	            <a href="#s1">分类</a>
	                    <ul class="submenu">
	                        <li>
	                        <a class="category-link" href="/amelin-ting/categories/Go/">Go</a></li><li><a class="category-link" href="/amelin-ting/categories/django/">django</a></li><li><a class="category-link" href="/amelin-ting/categories/drf/">drf</a></li><li><a class="category-link" href="/amelin-ting/categories/gin/">gin</a></li><li><a class="category-link" href="/amelin-ting/categories/go/">go</a></li><li><a class="category-link" href="/amelin-ting/categories/linux/">linux</a></li><li><a class="category-link" href="/amelin-ting/categories/mysql/">mysql</a></li><li><a class="category-link" href="/amelin-ting/categories/python/">python</a></li><li><a class="category-link" href="/amelin-ting/categories/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/">内网穿透</a></li><li><a class="category-link" href="/amelin-ting/categories/%E5%89%8D%E7%AB%AF/">前端</a>
	                    </ul>
	        </li>
	        
	        <!-- archives  归档   --> 
	        
	        
		        <!-- Pages 自定义   -->
		        
		        <li>
		            <a href="/about/" title="简历">
		                简历
		            </a>
		        </li>
		        
		        <li>
		            <a href="/group/" title="团队">
		                团队
		            </a>
		        </li>
		        
		        <li>
		            <a href="/gallery/" title="图库">
		                图库
		            </a>
		        </li>
		        
		        <li>
		            <a href="/tag/" title="标签">
		                标签
		            </a>
		        </li>
		        


            </ul>
            <!-- icons 图标   -->
			<ul class="icons">
                    
                    <li>
                        <a title="github" href="https://github.com/miccall" target="_blank" rel="noopener">
                            <i class="icon fa fa-github"></i>
                        </a>
                    </li>
                    
                    <li>
                        <a title="500px" href="http://500px.com" target="_blank" rel="noopener">
                            <i class="icon fa fa-500px"></i>
                        </a>
                    </li>
                    
			</ul>
</nav>

        <div id="main" >
            <div class ="post_page_title_img" style="height: 25rem;background-image: url(https://img1.baidu.com/it/u=469497334,2419657641&amp;fm=26&amp;fmt=auto);background-position: center; background-repeat:no-repeat; background-size:cover;-moz-background-size:cover;overflow:hidden;" >
                <a href="#" style="padding: 4rem 4rem 2rem 4rem ;"><h2 >Go字符串</h2></a>
            </div>
            <!-- Post -->
            <div class="typo" style="padding: 3rem;">
                <h2 id="一、字符串类型"><a href="#一、字符串类型" class="headerlink" title="一、字符串类型"></a>一、字符串类型</h2><figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span> 字符串类型</span><br><span class="line">	<span class="keyword">var</span> str <span class="keyword">string</span> = <span class="string">&quot;hello world&quot;</span></span><br><span class="line">	<span class="keyword">var</span> str <span class="keyword">string</span></span><br><span class="line">	<span class="comment">// Go语言中字符串使用双引号包裹的</span></span><br><span class="line">	<span class="comment">// Go语言中单引号包裹的是字符</span></span><br><span class="line"></span><br><span class="line"><span class="number">2.</span> 字符串输出占位符</span><br><span class="line">	%s</span><br><span class="line">	%v <span class="comment">// 万能占位符</span></span><br><span class="line"></span><br><span class="line"><span class="number">3.</span> 字符串的两种绑定方式</span><br><span class="line">	双引号  <span class="string">&quot;&quot;</span>   可以包含控制字符</span><br><span class="line">	反引号  <span class="string">``</span>   所有字符都是原样输出</span><br><span class="line"></span><br><span class="line"><span class="number">4.</span> <span class="keyword">type</span> 和 <span class="keyword">rune</span></span><br><span class="line">	<span class="comment">// rune 代表了UTF-8格式</span></span><br><span class="line">	<span class="comment">// type 则是二进制格式</span></span><br><span class="line">	<span class="keyword">package</span> main</span><br><span class="line"></span><br><span class="line">    <span class="keyword">import</span> (</span><br><span class="line">        <span class="string">&quot;fmt&quot;</span></span><br><span class="line">    )</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> &#123;</span><br><span class="line">        <span class="keyword">var</span> c <span class="keyword">rune</span></span><br><span class="line">        c = <span class="string">&#x27;我&#x27;</span></span><br><span class="line">        fmt.Printf(<span class="string">&quot;c=%d&quot;</span>, c)</span><br><span class="line">        fmt.Printf(<span class="string">&quot;d=%c&quot;</span>, c)</span><br><span class="line">	&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h2 id="二、字符串转义符-amp-常用方法"><a href="#二、字符串转义符-amp-常用方法" class="headerlink" title="二、字符串转义符&amp;常用方法"></a>二、字符串转义符&amp;常用方法</h2><figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span> 字符串转义符</span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    \r	回车符（返回行首）</span></span><br><span class="line"><span class="comment">    \n	换行符（直接跳到下一行的同列位置）</span></span><br><span class="line"><span class="comment">    \t	制表符</span></span><br><span class="line"><span class="comment">    \&#x27;	单引号</span></span><br><span class="line"><span class="comment">    \&quot;	双引号</span></span><br><span class="line"><span class="comment">    \\	反斜杠</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    <span class="keyword">package</span> main</span><br><span class="line">    <span class="keyword">import</span> (</span><br><span class="line">        <span class="string">&quot;fmt&quot;</span></span><br><span class="line">    )</span><br><span class="line">    <span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> &#123;</span><br><span class="line">        fmt.Println(<span class="string">&quot;str := \&quot;c:\\Code\\lesson1\\go.exe\&quot;&quot;</span>)</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"><span class="number">2.</span>字符串的常用操作</span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    len(str)	求长度</span></span><br><span class="line"><span class="comment">    +或fmt.Sprintf	拼接字符串</span></span><br><span class="line"><span class="comment">    strings.Split	分割</span></span><br><span class="line"><span class="comment">    strings.contains	判断是否包含</span></span><br><span class="line"><span class="comment">    strings.HasPrefix,strings.HasSuffix	前缀/后缀判断</span></span><br><span class="line"><span class="comment">    strings.Index(),strings.LastIndex()	子串出现的位置</span></span><br><span class="line"><span class="comment">    strings.Join(a[]string, sep string)	join操作</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line"></span><br><span class="line"><span class="number">3.</span> 字符串常用操作代码演示</span><br><span class="line">        <span class="keyword">package</span> main</span><br><span class="line"></span><br><span class="line">        <span class="keyword">import</span> (</span><br><span class="line">            <span class="string">&quot;fmt&quot;</span></span><br><span class="line">            <span class="string">&quot;strings&quot;</span></span><br><span class="line">        )</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> &#123;</span><br><span class="line">            name := <span class="string">&quot;Ame&quot;</span></span><br><span class="line">            path := <span class="string">&quot;D:\\GO\\misc\\ios&quot;</span></span><br><span class="line">            <span class="comment">// 求长度</span></span><br><span class="line">            l := <span class="built_in">len</span>(name) </span><br><span class="line">            fmt.Printf(<span class="string">&quot;len: %d\n&quot;</span>, l)</span><br><span class="line">            num := <span class="string">&quot;520&quot;</span></span><br><span class="line">            <span class="comment">// +拼接字符串</span></span><br><span class="line">            fmt.Println(name + num) </span><br><span class="line">            <span class="comment">// Sprint拼接字符串</span></span><br><span class="line">            newStr := fmt.Sprintf(<span class="string">&quot;%s%s&quot;</span>, name, num)</span><br><span class="line">            fmt.Println(newStr)</span><br><span class="line">            <span class="comment">// 分割字符串</span></span><br><span class="line">            splitStr := strings.Split(path, <span class="string">&quot;\\&quot;</span>) <span class="comment">// 要转义\\</span></span><br><span class="line">            fmt.Println(splitStr)</span><br><span class="line">            <span class="comment">// 判断是否包含A</span></span><br><span class="line">            isRigth := strings.Contains(name, <span class="string">&quot;A&quot;</span>)</span><br><span class="line">            fmt.Println(isRigth)</span><br><span class="line">            <span class="comment">// 前缀包含A</span></span><br><span class="line">            fmt.Println(strings.HasPrefix(name, <span class="string">&quot;A&quot;</span>))</span><br><span class="line">            <span class="comment">// 后缀包含e</span></span><br><span class="line">            fmt.Println(strings.HasSuffix(name, <span class="string">&quot;e&quot;</span>))</span><br><span class="line">            <span class="comment">// 子串出现的位置</span></span><br><span class="line">            cStr := <span class="string">&quot;123456&quot;</span> <span class="comment">// 先定义一个子串</span></span><br><span class="line">            fmt.Println(strings.Index(cStr, <span class="string">&quot;2&quot;</span>))</span><br><span class="line">            fmt.Println(strings.LastIndex(cStr, <span class="string">&quot;3&quot;</span>))</span><br><span class="line">            <span class="comment">// join操作</span></span><br><span class="line">            fmt.Println(strings.Join(splitStr, <span class="string">&quot;+&quot;</span>))</span><br><span class="line">        &#125;</span><br></pre></td></tr></table></figure>

<h2 id="三、字符串的byte-amp-rune类型"><a href="#三、字符串的byte-amp-rune类型" class="headerlink" title="三、字符串的byte&amp;rune类型"></a>三、字符串的byte&amp;rune类型</h2><figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span> 什么是字符</span><br><span class="line">	<span class="comment">// 组成每个字符串的元素叫做“字符”，可以通过遍历或者单个获取字符串元素获得字符</span></span><br><span class="line">	<span class="comment">// 字符用单引号（’）包裹起来，如：var a = &#x27;中&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="number">2.</span> Go语言的字符有以下两种:</span><br><span class="line">	<span class="number">1.</span><span class="keyword">uint8</span>类型，或者叫<span class="keyword">byte</span>型，代表了ASCII码的一个字符</span><br><span class="line">	<span class="number">2.</span><span class="keyword">rune</span>类型， 代表一个UTF<span class="number">-8</span>字符</span><br><span class="line"></span><br><span class="line"><span class="number">3.</span> <span class="keyword">byte</span>与<span class="keyword">rune</span>类型详解</span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    当需要处理中文、日文或者其他复合字符时，则需要用到rune类型。rune类型实际是一个int32。</span></span><br><span class="line"><span class="comment">    Go 使用了特殊的 rune 类型来处理 Unicode，让基于 Unicode 的文本处理更为方便，</span></span><br><span class="line"><span class="comment">    也可以使用 byte 型进行默认字符串处理，性能和扩展性都有照顾</span></span><br><span class="line"><span class="comment">    字符串底层是一个byte数组，所以可以和[]byte类型相互转换。</span></span><br><span class="line"><span class="comment">    字符串是不能修改的 字符串是由byte字节组成，所以字符串的长度是byte字节的长度。</span></span><br><span class="line"><span class="comment">    rune类型用来表示utf8字符，一个rune字符由一个或多个byte组成。</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line"></span><br><span class="line"><span class="number">4.</span> 修改字符串</span><br><span class="line">    <span class="comment">// 要修改字符串，需要先将其转换成[]rune或[]byte，完成后再转换为string。无论哪种转换，都会重新分配内存，并复制字节数组。</span></span><br><span class="line">    <span class="function"><span class="keyword">func</span> <span class="title">changeString</span><span class="params">()</span></span> &#123;</span><br><span class="line">        s1 := <span class="string">&quot;big&quot;</span></span><br><span class="line">        <span class="comment">// 强制类型转换</span></span><br><span class="line">        byteS1 := []<span class="keyword">byte</span>(s1)</span><br><span class="line">        byteS1[<span class="number">0</span>] = <span class="string">&#x27;p&#x27;</span></span><br><span class="line">        fmt.Println(<span class="keyword">string</span>(byteS1))</span><br><span class="line"></span><br><span class="line">        s2 := <span class="string">&quot;白萝卜&quot;</span></span><br><span class="line">        runeS2 := []<span class="keyword">rune</span>(s2)</span><br><span class="line">        runeS2[<span class="number">0</span>] = <span class="string">&#x27;红&#x27;</span></span><br><span class="line">        fmt.Println(<span class="keyword">string</span>(runeS2))</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h2 id="四、占位符"><a href="#四、占位符" class="headerlink" title="四、占位符"></a>四、占位符</h2><figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">%T  查看类型</span><br><span class="line">%v  查看变量值</span><br><span class="line">%#v 假如是字符串会加双引号</span><br><span class="line">%d  查看十进制</span><br><span class="line">%b  查看二进制</span><br><span class="line">%o  查看八进制</span><br><span class="line">%x  查看十六进制</span><br><span class="line">%s  查看字符串(必须得传入字符串)</span><br></pre></td></tr></table></figure>

<h2 id="五、课后小作业"><a href="#五、课后小作业" class="headerlink" title="五、课后小作业"></a>五、课后小作业</h2><figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span> 编写代码统计出字符串<span class="string">&quot;Ame雨雨雨&quot;</span>中汉字的数量</span><br><span class="line">	<span class="number">1.1</span> 第一种解法，利用unicode库</span><br><span class="line">        <span class="keyword">package</span> main</span><br><span class="line"></span><br><span class="line">        <span class="keyword">import</span> (</span><br><span class="line">            <span class="string">&quot;fmt&quot;</span></span><br><span class="line">            <span class="string">&quot;unicode&quot;</span></span><br><span class="line">        )</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> &#123;</span><br><span class="line">            <span class="comment">// 先定义一个次数变量</span></span><br><span class="line">            <span class="keyword">var</span> count <span class="keyword">int</span></span><br><span class="line">            <span class="comment">// 定义一个字符串</span></span><br><span class="line">            s1 := <span class="string">&quot;Ame雨雨雨&quot;</span></span><br><span class="line">            <span class="comment">// 依次拿到字符串中的字符</span></span><br><span class="line">            <span class="keyword">for</span> _, c := <span class="keyword">range</span> s1 &#123;</span><br><span class="line">                <span class="comment">// 判断字符串中是否为汉字</span></span><br><span class="line">                <span class="keyword">if</span> unicode.Is(unicode.Han, c) &#123;</span><br><span class="line">                    count++</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="comment">// 打印次数</span></span><br><span class="line">            fmt.Println(count)</span><br><span class="line">        &#125;</span><br><span class="line">	<span class="number">1.2</span> 第二种解法，不依赖unicode</span><br><span class="line">        <span class="keyword">package</span> main</span><br><span class="line"></span><br><span class="line">        <span class="keyword">import</span> (</span><br><span class="line">            <span class="string">&quot;fmt&quot;</span></span><br><span class="line">        )</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> &#123;</span><br><span class="line">            a := <span class="number">0</span></span><br><span class="line">            s1 := <span class="string">&quot;Ame雨雨雨&quot;</span></span><br><span class="line">            <span class="keyword">for</span> _, i := <span class="keyword">range</span> s1 &#123;</span><br><span class="line">                <span class="keyword">if</span> i &gt; <span class="string">&#x27;z&#x27;</span> &#123;</span><br><span class="line">                    a++</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            fmt.Println(a)</span><br><span class="line">		&#125;</span><br></pre></td></tr></table></figure>


            </div>

            <!-- Post Comments -->
            
    <!-- 使用 DISQUS_CLICK -->
<div id="disqus-comment">
    <div id="disqus_thread"></div>

<!-- add animation -->
<style>
	.disqus_click_btn {
            line-height: 30px;
            margin: 0;
            min-width: 50px;
            padding: 0 14px;
            display: inline-block;
            font-family: "Roboto", "Helvetica", "Arial", sans-serif;
            font-size: 14px;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0;
            overflow: hidden;
            will-change: box-shadow;
            transition: box-shadow .2s cubic-bezier(.4, 0, 1, 1), background-color .2s cubic-bezier(.4, 0, .2, 1), color .2s cubic-bezier(.4, 0, .2, 1);
            outline: 0;
            cursor: pointer;
            text-decoration: none;
            text-align: center;
            vertical-align: middle;
            border: 0;
            background: rgba(158, 158, 158, .2);
            box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
            color: #fff;
            background-color: #7EC0EE;
            text-shadow: 0
        }
</style>
	
<div class="btn_click_load" id="disqus_bt"> 
    <button class="disqus_click_btn">点击查看评论</button>
</div>

<!--
<script type="text/javascript">
$('.btn_click_load').click(function() {
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'http-miccall-tech'; // required: replace example with your forum shortname

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
      dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
      (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();

    document.getElementById('disqus_bt').style.display = "none";
});
</script>
-->
<script type="text/javascript">
    var disqus_config = function () {
        this.page.url = 'https://gitee.com/AmeX/amelin-ting.git/2020/03/04/Go%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B------%E5%AD%97%E7%AC%A6%E4%B8%B2/';  // Replace PAGE_URL with your page's canonical URL variable
        this.page.identifier = 'https://gitee.com/AmeX/amelin-ting.git/2020/03/04/Go%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B------%E5%AD%97%E7%AC%A6%E4%B8%B2/'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };
</script>

<script type="text/javascript">
    $('.btn_click_load').click(function() {  //click to load comments
        (function() { // DON'T EDIT BELOW THIS LINE
            var d = document;
            var s = d.createElement('script');
            s.src = '//http-miccall-tech.disqus.com/embed.js';
            s.setAttribute('data-timestamp', + new Date());
            (d.head || d.body).appendChild(s);
        })();
        $('.btn_click_load').css('display','none');
    });
</script>
</div>
<style>
    #disqus-comment{
        background-color: #eee;
        padding: 2pc;
    }
</style>


        </div>
        <!-- Copyright 版权 start -->
                <div id="copyright">
            <ul>
                <li>&copy;Powered By <a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/" style="border-bottom: none;">hexo</a></li>
                <li>Design: <a target="_blank" rel="noopener" href="http://miccall.tech " style="border-bottom: none;">miccall</a></li>
            </ul>
            
                <span id="busuanzi_container_site_pv">本站总访问量<span id="busuanzi_value_site_pv"></span>次</span>
			
        </div>
    </div>
</body>



 	
</html>
